#ifndef UICHAT_H
#define UICHAT_H

#include "Text.h"
#include "EventHandler.h"
#include "GameState.h"
#include "Singleton.h"

#include <string>
#include <string>
#include <stack>
#include <vector>

class UIChat : public EventHandler, public GameState, public Uncopyable
{
	UIChat();
	friend class Singleton<UIChat>;
public:
	~UIChat();

	virtual void Draw();
	virtual void Update();
	virtual void OnActivated();
	virtual void OnDeactivated();

	void AddSentence(const std::string& sentence);
	
	virtual void OnKeyDownEvent(const WPARAM& event);
	virtual void OnKeyUpEvent(const WPARAM& event);
	virtual void OnMouseMotionEvent(const LPARAM& event);
	virtual void OnMouseButtonDownEvent(const MSG& event);

private:
	std::vector<Text> m_sentences;
	bool m_takingInput;
	std::string m_currentSentence;

	//unsigned char* m_keyboardInput;

	Text m_canTakingInput;
	Text m_notTakingInput;
	Text m_currentInput;
	int m_lastKey;
	float m_pollKey;
	float m_pollAmount;
	float m_currentTimer;

	D3DXVECTOR3 m_textPosition;
	bool m_shiftDown;
};

typedef Singleton<UIChat> TheUIChatState;

#endif //UICHAT_H